const express = require('express')
const {queryDBPromise} = require('../util/db')
const bannerRouter = express.Router()

/**
 * 轮播列表
 *   method:GET,
 *   url:'/banner'
 */
bannerRouter.get('/banners',(req,res)=>{
    const sql = 'SELECT id,url,content FROM banner'
    queryDBPromise(sql).then(data=>{
        res.send({
            code:1,
            list:data
        })
    })
})

module.exports = {bannerRouter}